package com.topisv.tms.entity;

import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 部门表
 */
@Entity
@Table(name = "TBL_department")
public class Department extends IdEntity  {
	
	private static final long serialVersionUID = 1L;
	
	private String deptname;

	private String deptintro;

	private Long areagroupId;
	
	private AreaGroup areaGroup;

	private String address;

	private Date created;
	
	private Date updated;
	
	private String status;
	
	private Department department;
	
	private Long parentId;
	
	private List<Department> childMenu;
	
	public Department() {
	}

	public Department(Long id) {
		this.id = id;
	}

	/**
	 * @return the deptname
	 */
	public String getDeptname() {
		return deptname;
	}

	/**
	 * @param deptname the deptname to set
	 */
	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}

	/**
	 * @return the deptintro
	 */
	public String getDeptintro() {
		return deptintro;
	}

	/**
	 * @param deptintro the deptintro to set
	 */
	public void setDeptintro(String deptintro) {
		this.deptintro = deptintro;
	}

	@Transient
	@JsonIgnore
	public Long getAreagroupId() {
		return areagroupId;
	}

	/**
	 * @param areagroupId the areagroupId to set
	 */
	public void setAreagroupId(Long areagroupId) {
		this.areagroupId = areagroupId;
	}

	@ManyToOne
	@JoinColumn(name = "areagroup_id")
	public AreaGroup getAreaGroup() {
		return areaGroup;
	}

	/**
	 * @param areaGroup the areaGroup to set
	 */
	public void setAreaGroup(AreaGroup areaGroup) {
		this.areaGroup = areaGroup;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @return the created
	 */
	public Date getCreated() {
		return created;
	}

	/**
	 * @param created the created to set
	 */
	public void setCreated(Date created) {
		this.created = created;
	}

	/**
	 * @return the updated
	 */
	public Date getUpdated() {
		return updated;
	}

	/**
	 * @param updated the updated to set
	 */
	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the parentId
	 */
	@Transient
	@JsonIgnore
	public Long getParentId() {
		return parentId;
	}

	/**
	 * @param parentId the parentId to set
	 */
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	@ManyToOne
	@JoinColumn(name = "parent_id")
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Transient
	@JsonIgnore
	public List<Department> getChildMenu() {
		return childMenu;
	}

	/**
	 * @param childMenu the childMenu to set
	 */
	public void setChildMenu(List<Department> childMenu) {
		this.childMenu = childMenu;
	}
}